﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
//using Acidaes.Caching.Memcache;
//using System.Configuration.Provider;


using Acidaes.Caching;
using CachingTest;

public partial class CreateOrder : System.Web.UI.Page
{

    
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void CreateOrder_Click(object sender, EventArgs e)
    {
        string result = null;
        
        

        try
        {

            Order order = new Order();
            order.Id = Convert.ToInt32(OrderId.Text);
            order.Description = OrderDesc.Text;
            order.Amount = OrderAmt.Text;
            order.Quantity = Convert.ToInt32(OrderQuant.Text);

            CacheClient cu = new CacheClient();
            cu.Add(OrderId.Text, order);
            

            result = "Order " + OrderId.Text + " successfully created";
        }
        catch (Exception e1)
        {
            result = "Exception: " + e1.Message;
        }

        CreateResult.Text = result;
    }


}
